<%@ page import="com.zhiyou.entity.Lessee" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/21 0021
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page isELIgnored="false" %>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<html>
<script type="text/javascript">
    function doDelete(Id) {
        var con=confirm("确定要删除租户: "+Id+" 吗?");
        if(con){
            window.location.href="../lessee/delete?id="+Id;
        }
    }
</script>
<head>
    <title>租户信息展示界面</title>
</head>
<body>
<div class="row clearfix">
    <div class="col-md-12 column">
        <div class="page-header" style="margin-left: 500px">
            <h1>
                <small>租户信息展示界面</small>
            </h1>
        </div>
    </div>
</div>
<div style="margin-left: 1150px">
    <form class="form-inline" action="getLesseeLikeAll" method="post">
        <div class="form-group">
            <input type="text" name="likes" class="form-control" id="exampleInputEmail2" placeholder="请输入关键字进行查询">
        </div>
        <button type="submit" class="btn btn-info">搜索</button>
    </form>
    <div style="margin-left: 150px">
        <a class="btn btn-primary" href="../lessee/doAddLessee">新增</a>
    </div>
</div>
<table class="table table-hover">
    <thead>
    <tr>
        <td>ID</td>
        <td>租户姓名</td>
        <td>手机号</td>
        <td>性别</td>
        <td>籍贯</td>
        <td>身份证号</td>
        <td>添加时间</td>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="lessee" items="${lesseeList}">
        <tr>
            <td>${lessee.LId}</td>
            <td>${lessee.LName}</td>
            <td>${lessee.LTel}</td>
            <td>${lessee.LSex}</td>
            <td>${lessee.LNativeplace}</td>
            <td>${lessee.LIdcard}</td>
            <td>${lessee.LAddtime}</td>
            <td>
                <a class="btn btn-success" href="../lessee/toUpdate?id=${lessee.LId}">修改</a>
                <button type="button" class="btn btn-danger" onclick="doDelete(${lessee.LId})">删除</button>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<label style="color: #ff3b35">${msg}</label>
<div class="col-md-6">
    <nav aria-label="Page navigation">
        <ul class="pagination">
                <li><a href="${pageContext.request.contextPath}/lessee/getAll?pageNum=1">首页</a></li>
            <c:if test="${list.hasPreviousPage}">
                <li>
                    <a href="${pageContext.request.contextPath}/lessee/getAll?pageNum=${list.pageNum-1}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            </c:if>
            <c:forEach items="${list.navigatepageNums}" var="page_Num">
                <li><a href="${pageContext.request.contextPath}/lessee/getAll?pageNum=${page_Num}">${page_Num}</a></li>
            </c:forEach>
            <c:if test="${list.hasNextPage}">
                <li>
                    <a href="${pageContext.request.contextPath}/lessee/getAll?pageNum=${list.pageNum+1}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </c:if>
                <li><a href="${pageContext.request.contextPath}/lessee/getAll?pageNum=${list.pages}">末页</a></li>
        </ul>
    </nav>
</div>
</body>
</html>
